+Sun Feb 21 15:59:55 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/MwmUtil.h gdk/gdkwindow.c: Account for the
+ fact that Xlib expects format == 32 to be a long,
+ even on 64-bit architectures.
+
+ [ patch from George Lebl (jirka@5z.com) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
+Sun Feb 21 15:59:55 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/MwmUtil.h gdk/gdkwindow.c: Account for the
+ fact that Xlib expects format == 32 to be a long,
+ even on 64-bit architectures.
+
+ [ patch from George Lebl (jirka@5z.com) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
+Sun Feb 21 15:59:55 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/MwmUtil.h gdk/gdkwindow.c: Account for the
+ fact that Xlib expects format == 32 to be a long,
+ even on 64-bit architectures.
+
+ [ patch from George Lebl (jirka@5z.com) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
+Sun Feb 21 15:59:55 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/MwmUtil.h gdk/gdkwindow.c: Account for the
+ fact that Xlib expects format == 32 to be a long,
+ even on 64-bit architectures.
+
+ [ patch from George Lebl (jirka@5z.com) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
+Sun Feb 21 15:59:55 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/MwmUtil.h gdk/gdkwindow.c: Account for the
+ fact that Xlib expects format == 32 to be a long,
+ even on 64-bit architectures.
+
+ [ patch from George Lebl (jirka@5z.com) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
+Sun Feb 21 15:59:55 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/MwmUtil.h gdk/gdkwindow.c: Account for the
+ fact that Xlib expects format == 32 to be a long,
+ even on 64-bit architectures.
+
+ [ patch from George Lebl (jirka@5z.com) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
+Sun Feb 21 15:59:55 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/MwmUtil.h gdk/gdkwindow.c: Account for the
+ fact that Xlib expects format == 32 to be a long,
+ even on 64-bit architectures.
+
+ [ patch from George Lebl (jirka@5z.com) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
+ *
+ * * Feb 21 1999 - George Lebl (jirka@5z.com)
+ * Owen Taylor (otaylor@redhat.com)
+ *
+ * Modified so that the MotifWmHints structure defined here
+ * is suitable for client side use on 64-bit architectures.
+ * X expects fields with a format of 32 to be longs, even
+ * when sizeof(long) == 8.
**/
#ifndef MWMUTIL_H_INCLUDED
#endif
typedef struct {
- CARD32 flags;
- CARD32 functions;
- CARD32 decorations;
- INT32 input_mode;
- CARD32 status;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long input_mode;
+ unsigned long status;
} MotifWmHints, MwmHints;
#define MWM_HINTS_FUNCTIONS (1L << 0)
* _MWM_HINTS property
*/
typedef struct {
- CARD32 flags;
- CARD32 functions;
- CARD32 decorations;
- INT32 inputMode;
- CARD32 status;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long inputMode;
+ unsigned long status;
} PropMotifWmHints;
typedef PropMotifWmHints PropMwmHints;
* _MWM_INFO property, slight return
*/
typedef struct {
- CARD32 flags;
- CARD32 wmWindow;
+ unsigned long flags;
+ unsigned long wmWindow;
} PropMotifWmInfo;
typedef PropMotifWmInfo PropMwmInfo;
/*
*--------------------------------------------------------------
- * gdk_init
+ * gdk_init_heck
*
* Initialize the library for use.
*
* Results:
* "argc" and "argv" are modified to reflect any arguments
* which were not handled. (Such arguments should either
- * be handled by the application or dismissed).
+ * be handled by the application or dismissed). If initialization
+ * fails, returns FALSE, otherwise TRUE.
*
* Side effects:
* The library is initialized.
*--------------------------------------------------------------
*/
-void
-gdk_init (int *argc,
- char ***argv)
+gboolean
+gdk_init_check (int *argc,
+ char ***argv)
{
XKeyboardState keyboard_state;
gint synchronize;
gint argc_orig = 0;
if (gdk_initialized)
- return;
+ return TRUE;
if (g_thread_supported ())
gdk_threads_mutex = g_mutex_new ();
gdk_display = XOpenDisplay (gdk_display_name);
if (!gdk_display)
- {
- g_warning ("cannot open display: %s", XDisplayName (gdk_display_name));
- exit(1);
- }
+ return FALSE;
if (synchronize)
XSynchronize (gdk_display, True);
#endif
gdk_initialized = 1;
+
+ return TRUE;
+}
+
+void
+gdk_init (int *argc, char ***argv)
+{
+ if (!gdk_init_check (argc, argv))
+ {
+ g_warning ("cannot open display: %s", gdk_get_display ());
+ exit(1);
+ }
}
/*
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
void gdk_init (gint *argc,
gchar ***argv);
+gboolean gdk_init_check (gint *argc,
+ gchar ***argv);
void gdk_exit (gint error_code);
gchar* gdk_set_locale (void);
_XA_MOTIF_WM_HINTS, FALSE);
XGetWindowProperty (window_private->xdisplay, window_private->xwindow,
- hints_atom, 0, sizeof (MotifWmHints)/4,
+ hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, (guchar **)&hints);
XChangeProperty (window_private->xdisplay, window_private->xwindow,
hints_atom, hints_atom, 32, PropModeReplace,
- (guchar *)hints, sizeof (MotifWmHints)/4);
+ (guchar *)hints, sizeof (MotifWmHints)/sizeof (long));
if (hints != new_hints)
XFree (hints);
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
+ *
+ * * Feb 21 1999 - George Lebl (jirka@5z.com)
+ * Owen Taylor (otaylor@redhat.com)
+ *
+ * Modified so that the MotifWmHints structure defined here
+ * is suitable for client side use on 64-bit architectures.
+ * X expects fields with a format of 32 to be longs, even
+ * when sizeof(long) == 8.
**/
#ifndef MWMUTIL_H_INCLUDED
#endif
typedef struct {
- CARD32 flags;
- CARD32 functions;
- CARD32 decorations;
- INT32 input_mode;
- CARD32 status;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long input_mode;
+ unsigned long status;
} MotifWmHints, MwmHints;
#define MWM_HINTS_FUNCTIONS (1L << 0)
* _MWM_HINTS property
*/
typedef struct {
- CARD32 flags;
- CARD32 functions;
- CARD32 decorations;
- INT32 inputMode;
- CARD32 status;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long inputMode;
+ unsigned long status;
} PropMotifWmHints;
typedef PropMotifWmHints PropMwmHints;
* _MWM_INFO property, slight return
*/
typedef struct {
- CARD32 flags;
- CARD32 wmWindow;
+ unsigned long flags;
+ unsigned long wmWindow;
} PropMotifWmInfo;
typedef PropMotifWmInfo PropMwmInfo;
/*
*--------------------------------------------------------------
- * gdk_init
+ * gdk_init_heck
*
* Initialize the library for use.
*
* Results:
* "argc" and "argv" are modified to reflect any arguments
* which were not handled. (Such arguments should either
- * be handled by the application or dismissed).
+ * be handled by the application or dismissed). If initialization
+ * fails, returns FALSE, otherwise TRUE.
*
* Side effects:
* The library is initialized.
*--------------------------------------------------------------
*/
-void
-gdk_init (int *argc,
- char ***argv)
+gboolean
+gdk_init_check (int *argc,
+ char ***argv)
{
XKeyboardState keyboard_state;
gint synchronize;
gint argc_orig = 0;
if (gdk_initialized)
- return;
+ return TRUE;
if (g_thread_supported ())
gdk_threads_mutex = g_mutex_new ();
gdk_display = XOpenDisplay (gdk_display_name);
if (!gdk_display)
- {
- g_warning ("cannot open display: %s", XDisplayName (gdk_display_name));
- exit(1);
- }
+ return FALSE;
if (synchronize)
XSynchronize (gdk_display, True);
#endif
gdk_initialized = 1;
+
+ return TRUE;
+}
+
+void
+gdk_init (int *argc, char ***argv)
+{
+ if (!gdk_init_check (argc, argv))
+ {
+ g_warning ("cannot open display: %s", gdk_get_display ());
+ exit(1);
+ }
}
/*
_XA_MOTIF_WM_HINTS, FALSE);
XGetWindowProperty (window_private->xdisplay, window_private->xwindow,
- hints_atom, 0, sizeof (MotifWmHints)/4,
+ hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, (guchar **)&hints);
XChangeProperty (window_private->xdisplay, window_private->xwindow,
hints_atom, hints_atom, 32, PropModeReplace,
- (guchar *)hints, sizeof (MotifWmHints)/4);
+ (guchar *)hints, sizeof (MotifWmHints)/sizeof (long));
if (hints != new_hints)
XFree (hints);
}
-void
-gtk_init (int *argc,
- char ***argv)
+gboolean
+gtk_init_check (int *argc,
+ char ***argv)
{
GSList *gtk_modules = NULL;
GSList *slist;
gchar *env_string = NULL;
if (gtk_initialized)
- return;
+ return TRUE;
#if 0
g_set_error_handler (gtk_error);
/* Initialize "gdk". We pass along the 'argc' and 'argv'
* parameters as they contain information that GDK uses
*/
- gdk_init (argc, argv);
+ if (!gdk_init_check (argc, argv))
+ return FALSE;
gdk_event_handler_set ((GdkEventFunc)gtk_main_do_event, NULL, NULL);
}
}
g_slist_free (gtk_modules);
+
+ return TRUE;
+}
+
+void
+gtk_init (int *argc, char ***argv)
+{
+ if (!gtk_init_check (argc, argv))
+ {
+ g_warning ("cannot open display: %s", gdk_get_display ());
+ exit(1);
+ }
}
void
*/
void gtk_init (int *argc,
char ***argv);
+gboolean gtk_init_check (int *argc,
+ char ***argv);
void gtk_exit (gint error_code);
gchar* gtk_set_locale (void);
gint gtk_events_pending (void);